package com.blogs.web.game.factory.typefactory;

import com.blogs.web.game.Game;
import com.blogs.web.game.factory.AbstractFactory;
import com.blogs.web.game.type.Battleship;
import com.blogs.web.game.type.Marine;
import com.blogs.web.game.type.Tank;

/**
 * @Author: xiaokai
 * @Description: 实现人类工厂接口
 * @Date: 2019/8/18
 * @Version: 1.0
 */
public class HumanFactory implements AbstractFactory {

    //人族工厂坐标
    private int x;
    private int y;

    public HumanFactory(int x, int y) {
        this.x = x;
        this.y = y;
    }

    @Override
    public Game createLowClass() {
        Game game = new Marine(x, y);
        System.out.println("制造海军陆战队员成功。");
        return game;
    }

    @Override
    public Game createMidClass() {
        Game game = new Tank(x, y);
        System.out.println("制造变形坦克成功。");
        return game;
    }

    @Override
    public Game createHighClass() {
        Game game = new Battleship(x, y);
        System.out.println("制造巨型战舰成功。");
        return game;
    }
}
